﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterHome.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ADC.Web.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="Scripts/superfish.js" type="text/javascript"></script>
    <link href="Style/superfish.css" rel="stylesheet" type="text/css" />
    <link href="Style/superfish-vertical.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {

            $("#home_slider").slides({
                generatePagination: false,
                play: 7000,
                effect: 'slide',
                fadeSpeed: 50
            });

            // Run on the fist time
            $("#title").html($("#menu_" + $.urlParam('ID')).html());
            $("#content").html($("#menu_" + $.urlParam('ID')).children("label").html());

            $(".test").css("color", "#b8b8b8");
            $("#menu_" + $.urlParam('ID')).css("color", "#F58220");
            $("#menu_" + $.urlParam('ID')).css("background-image", "url('/Images/NewDesign/body/menu-right-point-active.png')");

            //show selected item:
            var selectedItem = document.getElementById("program_content_menu_" + $.urlParam('ID'));
            $(selectedItem).show();

            //click on menu
            $('.test').click(function () {
                $('.contentItem').hide();
                var content = document.getElementById("program_content_" + $(this).attr('id'));
                $(content).toggle();

                $('.test').css("background-image", 'url("/Images/NewDesign/body/menu-right-point-inactive.png")');
                $('.test').css("color", "#b8b8b8");

                $(this).css("background-image", "url('/Images/NewDesign/body/menu-right-point-active.png')");
                $(this).css("color", "#F58220");

            });
        });

        $.urlParam = function (name) {
            var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
            return results[1] || 0;
        }

        //keep content fit browser height
        function getWindowHeight() {
            var myHeight = 0;
            if (typeof (window.innerWidth) == 'number') {
                //Non-IE
                myHeight = window.innerHeight;
            } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                //IE 6+ in 'standards compliant mode'
                myHeight = document.documentElement.clientHeight;
            } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                //IE 4 compatible
                myHeight = document.body.clientHeight;
            }
            return myHeight;
        }
        function setContentHeight() {
            var windowHeight = getWindowHeight();
            var topMenuHeight = $('.sub-menu-top').outerHeight(true);
            var bigTitleHeight = $('.big-title-main').outerHeight(true);
            var footerHeight = $('.sub-footer-copyright').outerHeight(true);
            //alert(windowHeight - (topMenuHeight + bigTitleHeight + footerHeight));
            $('.sub-body-content').css("height", windowHeight - (topMenuHeight + bigTitleHeight + footerHeight + 20));
        }
        $(document).ready(function () {
            //set content fit screen height
            //setContentHeight();

            //fix background-image in IE
            if ($.browser.msie && parseInt($.browser.version, 10) === 8) {
                $('.sub-menu-top').css("background-size", "cover");
                $('.subpage-extra').css("background-size", "cover");
                $('.left-menu-top-boder').css("background-size", "cover");
                $('.left-menu-middle').css("background-size", "cover");
                $('.left-menu-bottom').css("background-size", "cover");
            }
        });

        //left menu
        $(document).ready(function () {

            $("#CruiseMenuMain").click(function () {
                $("#CruiseMenuItem").toggle();
                if ($("#CruiseMenuItem").is(':visible')) {
                    $("#CruiseMenuIcon").css("background-image", 'url("Images/NewDesign/body/minus.png")');
                }
                else {
                    $("#CruiseMenuIcon").css("background-image", 'url("Images/NewDesign/body/plus.png")');
                }
            });

            $("#PackageMenuMain").click(function () {
                $("#PackageMenuItem").toggle();
                if ($("#PackageMenuItem").is(':visible')) {
                    $("#PackageMenuIcon").css("background-image", 'url("Images/NewDesign/body/minus.png")');
                }
                else {
                    $("#PackageMenuIcon").css("background-image", 'url("Images/NewDesign/body/plus.png")');
                }
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="home-slider" id="home_slider">
        <div class="slides_container">

            <asp:ListView ID="listBanner" runat="server">
              <LayoutTemplate>
                  <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
              </LayoutTemplate>
              <ItemTemplate>
                <p class="slide1" style="background-image:url('<%#Eval("ImagePath")%>')">
                </p>
              </ItemTemplate>
            </asp:ListView>
        </div>
    </div>
    <div class="product-hot">
        <div class="product-hot-header">
            SẢN PHẨM HOT</div>
        <div class="product-hot-list">
            <ul class="product">

            <asp:ListView ID="ListViewProducts" runat="server">
                    <LayoutTemplate>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li class="product-item">
                    <div class="product-item-content">
                        <div class="product-item-image">
                            <img src=' <%#Eval("ImagePath")%>' height="136px" />
                        </div>
                        <div class="product-item-text">
                            <%#Eval("Name") %>
                        </div>
                        <div class="product-item-text">
                            <%#Eval("Model")%>
                        </div>
                        <div class="product-item-price-label">
                            Giá:
                        </div>
                        <div class="product-item-price">
                            <%#Eval("Price")%> VND
                        </div>
                        
                        <div class="product-item-button">
                           <a href='ProductDetails.aspx?ID=<%#Eval("ProductID")%>' >  <img src="Images/product-detail.jpg" /> </a>
                        </div>
                    </div>
                </li>
                </ItemTemplate>
                </asp:ListView>
            </ul>
        </div>
    </div>
    <div class="project-hot">
        <div class="project-header">
            DỰ ÁN TIÊU BIỂU</div>
        <div class="project-hot-list">
            <ul class="product">

             <asp:ListView ID="ListViewProject" runat="server">
                    <LayoutTemplate>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                    </LayoutTemplate>
                    <ItemTemplate>
                       <li class="project-item">
                    <div class="product-item-content">
                        <div class="project-item-image">
                            <img src='<%#Eval("ImagePath")%>'  height="150px"/>
                        </div>
                        <div class="project-item-text">
                           <a class="link-title" href='ProjectDetail.aspx?ID=<%#Eval("ProjectID")%>'> <%#Eval("Title")%> </a>
                        </div>
                    </div>
                </li>
                </ItemTemplate>
                </asp:ListView>




                
            </ul>
            <div style="clear: both;">
            </div>
        </div>
    </div>
</asp:Content>
